import 'dart:io' as io;
import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:path_provider/path_provider.dart';

class FileHelper {
  static String flexolinkDirectory = '';
  static Future<void> init() async {
    if (Platform.isAndroid) {
      flexolinkDirectory = (await  getTemporaryDirectory()).path;
    } else {
      flexolinkDirectory = (await  getTemporaryDirectory()).path;
    }
  }

  ///path目录，是否包含某个文件
  static Future<bool> containFile({required String fileName}) async {
    var syncPath = '$flexolinkDirectory/$fileName';
    return io.File(syncPath).existsSync();
  }
  static Future<String> completeFilePath({required String fileName}) async {
    return '$flexolinkDirectory/$fileName';
  }
}